<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
</head>
<body>
	<%
		String name = request.getParameter("username");
		if (name == null) {
	%>
	<form method="post">
		<table>
			<tr>
				<td>Username</td>
				<td><input type="text" name="username" /></td>
			</tr>
			<tr>
				<td><input type="submit" value="Submit" /></td>
				<td><input type="reset" value="Reset" /></td>
			</tr>
		</table>
	</form>
	<%
		} else {
	%>
	<jsp:useBean id="test" class="assignment.day3.D3A7Validate" />
	<jsp:setProperty name="test" property="name" value="<%=name%>" />
	<%
		if (test.display()) {
	%>
	<jsp:forward page="d3a5-welcome.jsp" />
	<%
		} else
	%>
	<h2>Access denied</h2>
	<%
		}
	%>
</body>
</html>